#!/bin/bash

HOME_PATH=/usr1/EcmaCI/openharmony-master

export LD_LIBRARY_PATH=$HOME_PATH/out/rk3568/clang_x64/ark/ark:$HOME_PATH/out/rk3568/clang_x64/ark/ark_js_runtime:$HOME_PATH/out/rk3568/clang_x64/thirdparty/icu

ARK_JS_VM=$HOME_PATH/out/rk3568/clang_x64/ark/ark_js_runtime/ark_js_vm 

JS_FILE_PATH=./lib
JS_FILE_PATH_FOR_NODE=./lib-for-node
ABC_PATH=./lib

$HOME_PATH/prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node --expose-gc $HOME_PATH/out/rk3568/clang_x64/ark/ark/build/src/index.js $JS_FILE_PATH/run_crypto.js
$HOME_PATH/prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node --expose-gc $HOME_PATH/out/rk3568/clang_x64/ark/ark/build/src/index.js $JS_FILE_PATH/run_earley-boyer.js
$HOME_PATH/prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node --expose-gc $HOME_PATH/out/rk3568/clang_x64/ark/ark/build/src/index.js $JS_FILE_PATH/run_raytrace.js
$HOME_PATH/prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node --expose-gc $HOME_PATH/out/rk3568/clang_x64/ark/ark/build/src/index.js $JS_FILE_PATH/run_splay.js
$HOME_PATH/prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node --expose-gc $HOME_PATH/out/rk3568/clang_x64/ark/ark/build/src/index.js $JS_FILE_PATH/run_box2d.js
$HOME_PATH/prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node --expose-gc $HOME_PATH/out/rk3568/clang_x64/ark/ark/build/src/index.js $JS_FILE_PATH/run_navier-stokes.js
$HOME_PATH/prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node --expose-gc $HOME_PATH/out/rk3568/clang_x64/ark/ark/build/src/index.js $JS_FILE_PATH/run_richards.js
$HOME_PATH/prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node --expose-gc $HOME_PATH/out/rk3568/clang_x64/ark/ark/build/src/index.js $JS_FILE_PATH/run_deltablue.js
$HOME_PATH/prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node --expose-gc $HOME_PATH/out/rk3568/clang_x64/ark/ark/build/src/index.js $JS_FILE_PATH/run_regexp.js
$HOME_PATH/prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node --expose-gc $HOME_PATH/out/rk3568/clang_x64/ark/ark/build/src/index.js $JS_FILE_PATH/run_mandreel.js
$HOME_PATH/prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node --expose-gc $HOME_PATH/out/rk3568/clang_x64/ark/ark/build/src/index.js $JS_FILE_PATH/run_pdfjs.js
$HOME_PATH/prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node --expose-gc $HOME_PATH/out/rk3568/clang_x64/ark/ark/build/src/index.js $JS_FILE_PATH/run_typescript.js

echo "           "
echo "=============run asm interpreter=============="

$ARK_JS_VM --asm-interpreter=true $ABC_PATH/run_crypto.abc
$ARK_JS_VM --asm-interpreter=true $ABC_PATH/run_earley-boyer.abc
$ARK_JS_VM --asm-interpreter=true $ABC_PATH/run_raytrace.abc
$ARK_JS_VM --asm-interpreter=true $ABC_PATH/run_splay.abc
$ARK_JS_VM --asm-interpreter=true $ABC_PATH/run_box2d.abc
$ARK_JS_VM --asm-interpreter=true $ABC_PATH/run_navier-stokes.abc
$ARK_JS_VM --asm-interpreter=true $ABC_PATH/run_richards.abc
$ARK_JS_VM --asm-interpreter=true $ABC_PATH/run_deltablue.abc
$ARK_JS_VM --asm-interpreter=true $ABC_PATH/run_regexp.abc
$ARK_JS_VM --asm-interpreter=true $ABC_PATH/run_mandreel.abc
$ARK_JS_VM --asm-interpreter=true $ABC_PATH/run_pdfjs.abc
$ARK_JS_VM --asm-interpreter=true $ABC_PATH/run_typescript.abc

echo "           "
echo "=============run v8 node no opt=============="

node --no-opt $JS_FILE_PATH_FOR_NODE/run_crypto.js
node --no-opt $JS_FILE_PATH_FOR_NODE/run_earley-boyer.js
node --no-opt $JS_FILE_PATH_FOR_NODE/run_raytrace.js
node --no-opt $JS_FILE_PATH_FOR_NODE/run_splay.js
node --no-opt $JS_FILE_PATH_FOR_NODE/run_box2d.js
node --no-opt $JS_FILE_PATH_FOR_NODE/run_navier-stokes.js
node --no-opt $JS_FILE_PATH_FOR_NODE/run_richards.js
node --no-opt $JS_FILE_PATH_FOR_NODE/run_deltablue.js
node --no-opt $JS_FILE_PATH_FOR_NODE/run_regexp.js
node --no-opt $JS_FILE_PATH_FOR_NODE/run_mandreel.js
node --no-opt $JS_FILE_PATH_FOR_NODE/run_pdfjs.js
node --no-opt $JS_FILE_PATH_FOR_NODE/run_typescript.js
